<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('带机构权限的维度数据')" />
    <th:block th:include="include :: bootstrap-select-css" />
    <style>
        #bootstrap-table tr th,td {
            width: 100px; /* 设置最小宽度 */
            overflow: hidden; /* 超出最小宽度的内容会被隐藏 */
            text-overflow: ellipsis; /* 超出部分显示省略号 */
            white-space: nowrap; /* 不换行 */
        }
    </style>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <input type="hidden" th:value="${paramId}" id="paramId">
                <div class="select-list">
                    <ul>
                        <li class="select-selectpicker">
                            <label>社康： </label>
                            <select id="cdOrg" onchange="dataRefresh()" data-none-selected-text="请选择"  th:with="type=${@sysDeptService.selectDeptsByUserId(0)}">
                                <option th:each="item : ${type}" th:text="${item.deptName}" th:value="${item.deptCode}" ></option>
                            </select>
                        </li>
                        <li>
                            <a class="btn btn-danger btn-rounded btn-sm" onclick="toExport()"><i class="fa fa-download"></i>&nbsp;导出</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-bordered">
            <p style="color: red">数据量过大，只展示前100条，查看全部请导出</p>
            <table id="bootstrap-table" class="table table-bordered"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/ruoyi/js/table-data.js}"></script>
<th:block th:include="include :: bootstrap-select-js" />
<th:block th:include="include :: bootstrap-table-fixed-columns-js" />
<script th:inline="javascript">
    function toExport(){
        dimParamTableDataExport({"paramId":$("#paramId").val(),"paramMap":{"CD_ORG":$("#cdOrg").val()}});
    }
    function dataRefresh(){
        dimParamTableDataInit({"paramId":$("#paramId").val(),"pageSize":100,"paramMap":{"CD_ORG":$("#cdOrg").val()}});
    }
    $(function() {
        $("#cdOrg").val(parent.$("#deptName").attr("deptCode"));
        dataRefresh();
    });
</script>
</body>
</html>